package com.bifang.core.dao.model;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * 系统路由表
 *
 * @author chenzh
 * @since 2020-06-17
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("SYS_ROUTER")
@ApiModel(value = "SysRouter对象", description = "系统路由表")
public class OplogRouter extends Model<OplogRouter> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "路由id")
    @TableId(value = "ROUTER_ID", type = IdType.INPUT)
    private String routerId;

    @ApiModelProperty(value = "系统url路径标识")
    @TableField("`KEY`")
    private String key;

    @ApiModelProperty(value = "路由名称（作为菜单名称）")
    @TableField("TITLE")
    private String title;

    @ApiModelProperty(value = "路由名称, 必须设置,且不能重名")
    @TableField("`NAME`")
    private String name;

    @ApiModelProperty(value = "模板")
    @TableField("COMPONENT")
    private String component;

    @ApiModelProperty(value = "重定向地址, 访问这个路由时,自定进行重定向")
    @TableField("REDIRECT")
    private String redirect;

    @ApiModelProperty(value = "图标 svg格式")
    @TableField("ICON")
    private String icon;

    @ApiModelProperty(value = "控制路由是否显示  0 否 1 是")
    @TableField("HIDDEN")
    private String hidden;

    @ApiModelProperty(value = "强制菜单显示为叶子Item而不是节点SubItem(配合 meta.hidden)	")
    @TableField("HIDE_CHILDREN_IN_MENU")
    private String hideChildrenInMenu;

    @ApiModelProperty(value = "父路由id")
    @TableField("PARENT_ID")
    private String parentId;

    @ApiModelProperty(value = "是否缓存该路由  0 否 1 是")
    @TableField("KEEP_ALIVE")
    private String keepAlive;

    @ApiModelProperty(value = "*特殊 隐藏 PageHeader ")
    @TableField("HIDDEN_HEADER_CONTENT")
    private String hiddenHeaderContent;

    @ApiModelProperty(value = "*特殊 隐藏 PageHeader 组件中的页面带的 面包屑")
    @TableField("HIDDEN_BREADCRUMB")
    private String hiddenBreadcrumb;

    @ApiModelProperty(value = "是否禁用  0 否 1 是")
    @TableField("DISABLED")
    private String disabled;

    @ApiModelProperty(value = "同级序号")
    @TableField("ORDER_NO")
    private Integer orderNo;

    @ApiModelProperty(value = "描述")
    @TableField("REMARKS")
    private String remarks;

    @ApiModelProperty(value = "自定义参数1")
    @TableField("PARAM1")
    private String param1;

    @ApiModelProperty(value = "自定义参数2")
    @TableField("PARAM2")
    private String param2;

    @ApiModelProperty(value = "自定义参数3")
    @TableField("PARAM3")
    private String param3;

    @ApiModelProperty(value = "自定义参数4")
    @TableField("PARAM4")
    private String param4;

    @ApiModelProperty(value = "摘要信息")
    @TableField("DIGEST")
    private String digest;

    @ApiModelProperty(value = "级别")
    @TableField("RATE")
    private Integer rate;

    @ApiModelProperty(value = "操纵期控制规则")
    @TableField("OPERATING")
    private String operating;

    @ApiModelProperty(value = "是否记录日志 0 否 1 是")
    @TableField("LOG_FLAG")
    private String logFlag;

    @ApiModelProperty(value = "是否 允许回退 0 否 1 是 作废")
    @TableField("ROLLBACK_FLAG")
    private String rollbackFlag;

    @ApiModelProperty(value = "是否公共方法 0 否 1 是")
    @TableField("PUBLIC_FLAG")
    private String publicFlag;

    @ApiModelProperty(value = "是否需要审核 0 不需要 1需要")
    @TableField("AUDIT_FLAG")
    private String auditFlag;

    @ApiModelProperty(value = "创建人")
    @TableField(
            value = "CREATE_NAME",
            fill = FieldFill.INSERT,
            updateStrategy = FieldStrategy.NOT_NULL)
    private String createName;

    @ApiModelProperty(value = "创建时间")
    @TableField(
            value = "CREATE_TIME",
            fill = FieldFill.INSERT,
            updateStrategy = FieldStrategy.NOT_NULL)
    private Date createTime;

    @ApiModelProperty(value = "修改人")
    @TableField(
            value = "UPDATE_NAME",
            fill = FieldFill.INSERT_UPDATE,
            updateStrategy = FieldStrategy.NOT_NULL)
    private String updateName;

    @ApiModelProperty(value = "更新时间")
    @TableField(
            value = "UPDATE_TIME",
            fill = FieldFill.INSERT_UPDATE,
            updateStrategy = FieldStrategy.NOT_NULL)
    private Date updateTime;

    @ApiModelProperty(value = "逻辑删除标志 0 正常 1 删除")
    @TableField(value = "DEL", fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NOT_NULL)
    @TableLogic
    private String del;

    @ApiModelProperty(value = "节点类型 0 节点 1 叶子")
    @TableField("NODE_TYPE")
    private String nodeType;

    @ApiModelProperty(value = "是否允许跨业务期回退 0 否 1 是")
    @TableField("SPAN_ROLLBACK_FLAG")
    private String spanRollbackFlag;

    @ApiModelProperty(value = "忽略回退跨业务的业务类型")
    @TableField("IGNORE_RB_OP")
    private String ignoreRbOp;

    @ApiModelProperty(value = "同一数据类型业务不允许一起待办的业务类型")
    @TableField("NOT_DOING_OP")
    private String notDoingOp;

    @Override
    public Serializable pkVal() {
        return this.routerId;
    }
}
